﻿<!DOCTYPE html>
<html>
<head>
    <!--    <title>{$platform.name}</title>-->
    <!--    <link href="/static/css/framework-font.css" rel="stylesheet"/>-->
    <!--    <script src="/static/js/jquery-2.1.1.js"></script>-->
    <!--    <script src="/static/bootstrap/js/bootstrap.js"></script>-->
    <!--    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>-->

    <!--    <script src="/static/js/jquery.cookie.js"></script>-->
    <!--    <link href="/static/css/framework-theme.css" rel="stylesheet"/>-->
    <!--    &lt;!&ndash;弹框js&ndash;&gt;-->
    <!--    <script src="/static/js/yii.js"></script>-->

    <!--    &lt;!&ndash;引用layui弹框插件&ndash;&gt;-->
    <!--    <script src="/static/layui/layui.all.js"></script>-->
    <!--    <script src="/static/layui/layui.js"></script>-->
    <!--    <link href="/static/layui/css/layui.css" rel="stylesheet"/>-->
    <!--    <script src="/static/layui/lay/modules/layer.js"></script>-->



    <!--        {if condition="$swidthStyle eq 0"}
    <link href="/static/css/pattern/public.css" rel="stylesheet"/>
    {else/}
    <link href="/static/css/default/public.css" rel="stylesheet"/>
    {/if}-->


</head>
<body>
<style>
    .modal-dialog{width:750px!important;}
    .modal-body {
        background-color: #fff;
        padding: 15px
    }

    .page-header {
        margin-top: 15px !important;
    }

    .geographic input {
        width: 100px !important;
        float: left;
        margin-right: 15px;
    }

    .new-content {
        padding: 15px 0px
    }

    .config_img {
        width: 45px;
        height: 45px;
        margin-top: 15px;
    }
</style>

<div class="modal-body">


    <div class="page-header">
        <div class="assistant_header">
            <button type="button" class="close" data-dismiss="modal" close="true">
                <span aria-hidden="true">×</span>
            </button>
            <h4 class="modal-title">
                <span class="fa fa-legal"></span>&nbsp;添加奖项
            </h4>
        </div>
    </div>

    <div class="new-content">

        <form class="form-horizontal layui-form">

            <div class="form-group">
                <label class="col-sm-2 control-label">*奖励积分:</label>
                <div class="col-sm-3">
                    <input class="form-control" type="text" name="integral" value="{$detail.integral}">
                </div>

                <label class="col-sm-2 control-label">*概率(%):</label>
                <div class="col-sm-3">
                    <input class="form-control" type="text" name="probability" value="{$detail.probability}">
                </div>
            </div>

            <input type="hidden" name="id" value="{$detail.id}">

        </form>
    </div>

    <div class="assistant_button">
        <button type="button" class="layui-btn layui-btn-primary js_quit" close="true">取消</button>
        <!--        <button type="button" class="btn btn-primary btn-sm js_add" _event="add" data-id="0" data-name="">保存</button>-->
        <button type="button" class="layui-btn js_add">保存</button>
    </div>

</div>



<script>

    layui.use(['form', 'layedit', 'tree', 'util','laydate'], function () {
        var form = layui.form
            , layer = layui.layer;
        var layedit = layui.layedit;
        var tree = layui.tree;
        var util = layui.util;
        var laydate = layui.laydate;

        $(".js_add").click(function () {

            var data = $("form").serializeArray();
            $.ajax({
                type:'post',
                url:"{:URL('community/Market/doPrize')}",
                data:data,
                dataType:'JSON',
                success:function (res) {
                    if(res.code!=0){
                        layer.alert(res.msg);
                    }else{
                        window.location.href = "{:URL('community/market/prize')}";
                        //$(".js_quit").click();
                    }
                },
                error:function (res) {

                }
            });
        });

        layui.form.render('select');
        form.render();
    });
</script>

</body>
</html>